<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="../js/vue.js"></script>
</head>
<body>
    <div id="root">
        <!-- 直接让该结构消失 -->
        <h1 v-if="a">hello if</h1>
        <!-- 添加属性style="display: none;"使之不展示 -->
        <h1 v-show="a" >hello show</h1>
        <button @click="isshow">点我{{a ? '隐藏' : '显示'}}</button>
    </div>
    
    <script type="text/javascript">

        new Vue({
            el:"#root",
            data:{
                a:true,
                info:'隐藏'
            },
            methods: {
                isshow(){
                    this.a = !this.a
                }
            }
        })
    </script>
</body>
</html>